package com.designpattern.softwaredesignpatternstudy.pdai.chain;

/**
 * @author: Aster
 * @note:
 * @create: 2025-07-18 13:40
 **/
public class ConcreteHandler2 extends Handler {
    public ConcreteHandler2(Handler successor) {
        super(successor);
    }

    @Override
    protected void handleRequest(Request request) {
        if (request.getRequestType() == RequestType.REQUEST_TYPE_2) {
            System.out.println("ConcreteHandler2 handles request " + request.getName());
            return;
        }
        if (successor != null) {
            successor.handleRequest(request);
        }
    }
}
